<?php
require('includes/class.main.php');
$manager = new MeetingManager();
include('template/header.php');
include('includes/format-price.php');
$lookup = new StoreLookup();
$pages = $lookup->getPages();
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <?php MeetingManager::echoMetaData(); ?>
</head>  	
<body>
 	<div class="content">
  	
  	<?php include_once 'template/menu.php'; ?>
	<div class="subheader">
	</div>
  	
  	<div class="center">

<div class="left">

	<div class="blurb">
		<b><span class="blue">Store Categories</span> </b><br>
		<?
		while ($page = $pages->fetch_row()) {
			echo "- <a href=\"store.php?page=".urlencode($page[0])."\">".$page[0]."</a><br>\n ";
		}
		?>

	</div>

	<div class="blurb">
		<b><span class="blue">Shopping Cart</span> </b><br> Please select
		return in your browser to resume shopping from our site. You may also
		click here to <a href="javascript: viewCart();">view your cart.</a> at
		any time.
	</div>

	<div class="blurb">
		<b><span class="blue">Shipping and Handling</span> </b><br> The
		following shipping and handling charges will be added during checkout.<br>
		<br>
		<table cellspacing=0>
			<tr>
				<td width=100><b>Subtotal</b></td>
				<td><b> S/H Charge</b></td>
			</tr>
			<tr>
				<td>$0.01 - $20.00</td>
				<td style="text-align: center">50%</td>
			</tr>
			<tr>
				<td>$20.01 - $50.00</td>
				<td style="text-align: center">30%</td>
			</tr>
			<tr>
				<td>$50.01 - $200.00</td>
				<td  style="text-align: center">18%</td>
			</tr>
			<tr>
				<td>$200.01 - $400.00</td>
				<td style="text-align: center">15%</td>
			</tr>
			<tr>
				<td>$400.01 or more</td>
				<td style="text-align: center">10%</td>
			</tr>
		</table>
	</div>
</div>

<div class="right">
	<h1>
		<span class="blue">Online Store</span>
	</h1>
	<br>

	<?


	if (isset($_GET['page'])) {
		$page = $_GET['page'];
		print "<b><span class=\"blue\">".$page."</span></b><br>";
		$details = $lookup->getDetails($page);

		while ($detail = $details->fetch_row()) {
			echo "<div style=\"border: 1px dashed #D7D7D7;\">\n";
			echo "<b>$detail[3]</b><br>\n";
	  if ($detail[5]) {
	  	echo "<i>$detail[5]</b><br>\n";
	  }
	  echo "Price &nbsp;&nbsp;&nbsp;&nbsp;: $".format_price($detail[4])."<br>\n";
	  echo "Item No:  $detail[2]<br>\n";
	  echo "<form target=\"_self\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n";
	  echo "<input type=\"image\" src=\"images/add_to_cart.gif\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">\n";
	  echo "<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n";
	  echo "<input type=\"hidden\" name=\"add\" value=\"1\">\n";
	  echo "<input type=\"hidden\" name=\"cmd\" value=\"_cart\">\n";
	  echo "<input type=\"hidden\" name=\"business\" value=\"atlantaaaonline@mindspring.com\">\n";
	  echo "<input type=\"hidden\" name=\"item_name\" value=\"Item No.".$detail[2].", ".$detail[3]."\">\n";
	  echo "<input type=\"hidden\" name=\"amount\" value=\"".$detail[4]."\">\n";
	  echo "<input type=\"hidden\" name=\"no_note\" value=\"1\">\n";
	  echo "<input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n";
	  echo "<input type=\"hidden\" name=\"bn\" value=\"PP-ShopCartBF\">\n";
	  echo "</form>\n";
	  echo "</div><br>\n";

		}

	} else {
		print $lookup->defaultContent();
	}

	?>
</div>

<form name="_cart" target="paypal"
	action="https://www.paypal.com/cgi-bin/webscr" method="post">
	<input type="hidden" name="cmd" value="_cart"> <input type="hidden"
		name="business" value="atlantaaaonline@mindspring.com"> <input
		type="hidden" name="display" value="1">
</form>

<? include('template/footer.php'); ?>
</div>
</div>
</body>
</html>
